#include "Color.hpp"

namespace fge
{
const Color Color::White(1, 1, 1, 1);
const Color Color::Black(0, 0, 0, 1);

Color::Color()
	: r(0), g(0), b(0), a(0)
{
}

Color::Color(float r, float g, float b, float a)
	: r(r), g(g), b(b), a(a)
{
}

Color& Color::operator+=(const Color &c)
{
	r += c.r;
	g += c.g;
	b += c.b;
	a += c.a;
	return *this;
}

Color& Color::operator-=(const Color &c)
{
	r -= c.r;
	g -= c.g;
	b -= c.b;
	a -= c.a;
	return *this;
}

Color& Color::operator*=(const float f)
{
	r *= f;
	g *= f;
	b *= f;
	a *= f;
	return *this;
}

Color& Color::operator/=(const float f)
{
	r /= f;
	g /= f;
	b /= f;
	a /= f;
	return *this;
}

const Color operator+(const Color &lhs, const Color &rhs)
{
	return Color(lhs) += rhs;
}

const Color operator-(const Color &lhs, const Color &rhs)
{
	return Color(lhs) -= rhs;
}

const Color operator*(const float lhs, const Color &rhs)
{
	return Color(rhs) *= lhs;
}

const Color operator*(const Color &lhs, const float rhs)
{
	return Color(lhs) *= rhs;
}

const Color operator/(const Color &lhs, const float rhs)
{
	return Color(lhs) * rhs;
}

}
